package com.gem.card;

import com.gem.entity.Card;
import com.gem.enums.CardType;
import com.gem.enums.GemType;
import com.gem.entity.Gem;

import java.util.ArrayList;
import java.util.List;

/** 一级卡
 * Author: Xhy
 * CreateTime: 2022-09-17 15:38
 */
public class AdvancedCard extends Card {

    public Integer type = CardType.ADVANCED_CARD.getType();

    private static Integer no = 70;
    // init cards 20
    private static ArrayList<Card> cards = new ArrayList<>();

    /**
     * 初始化高级卡牌
     */
    static {
        cards.add(createAdvancedCardAndWhiteBuff(new Gem().white(3).red(3).black(6),4));
        cards.add(createAdvancedCardAndWhiteBuff(new Gem().blue(3).black(3).red(5).green(3),3));
        cards.add(createAdvancedCardAndWhiteBuff(new Gem().white(3).black(7),5));
        cards.add(createAdvancedCardAndWhiteBuff(new Gem().black(7),4));
        cards.add(createAdvancedCardAndBLUEBuff(new Gem().white(6).blue(3).black(3),4));
        cards.add(createAdvancedCardAndBLUEBuff(new Gem().white(3).black(5).green(3).red(3),3));
        cards.add(createAdvancedCardAndBLUEBuff(new Gem().white(7).blue(3),5));
        cards.add(createAdvancedCardAndBLUEBuff(new Gem().white(7),4));
        cards.add(createAdvancedCardGreenBuff(new Gem().blue(7),4));
        cards.add(createAdvancedCardGreenBuff(new Gem().white(3).blue(6).green(3),4));
        cards.add(createAdvancedCardGreenBuff(new Gem().blue(7).green(3),5));
        cards.add(createAdvancedCardGreenBuff(new Gem().red(3).white(5).blue(3).black(3),3));
        cards.add(createAdvancedCardAndBlackBuff(new Gem().green(3).red(6).black(3),4));
        cards.add(createAdvancedCardAndBlackBuff(new Gem().red(7).black(3),5));
        cards.add(createAdvancedCardAndBlackBuff(new Gem().red(3).white(3).green(5).blue(3),3));
        cards.add(createAdvancedCardAndBlackBuff(new Gem().red(7),4));
        cards.add(createAdvancedCardAndRedBuff(new Gem().green(7),4));
        cards.add(createAdvancedCardAndRedBuff(new Gem().black(3).blue(5).green(3).white(3),3));
        cards.add(createAdvancedCardAndRedBuff(new Gem().green(7).red(3),5));
        cards.add(createAdvancedCardAndRedBuff(new Gem().blue(3).green(6).red(3),4));
    }

    public static List<Card> init(){

        return cards;
    }

    public AdvancedCard(){}
    private AdvancedCard(Gem gem, Integer cardBuff, Integer score) {
        super.type = CardType.ADVANCED_CARD.type;
        super.gems = gem.toMap();
        super.cardBuff = cardBuff;
        super.score = score;
        super.no = no++;
    }

    private static AdvancedCard createAdvancedCardAndRedBuff(Gem gem,Integer score){
        return new AdvancedCard(gem, GemType.RED.getType(),score);
    }

    private static AdvancedCard createAdvancedCardAndWhiteBuff(Gem gem,Integer score){
        return new AdvancedCard(gem,GemType.WHITE.getType(),score);
    }

    private static AdvancedCard createAdvancedCardAndBlackBuff(Gem gem,Integer score){
        return new AdvancedCard(gem,GemType.BLACK.getType(),score);
    }

    private static AdvancedCard createAdvancedCardGreenBuff(Gem gem,Integer score){
        return new AdvancedCard(gem,GemType.GREEN.getType(),score);
    }

    private static AdvancedCard createAdvancedCardAndBLUEBuff(Gem gem,Integer score){
        return new AdvancedCard(gem,GemType.BLUE.getType(),score);
    }
}
